package homework;

public class Car2 {//自造一个数据类型
    //成员变量
    String brand;
    String color;
    double price;
    int capacity;

    Car2(){
    }
    Car2(String brand,String color,double price,int capacity){
    this.brand=brand;
    this.color=color;
    this.price=price;
    this.capacity=capacity;
    }
    void start(){
        System.out.println(brand+"牌子的"+color+"颜色的"+price+"价格的"+capacity+"座的车启动了...");
    }
    void run(){
        System.out.println(brand+"牌子的"+color+"颜色的"+price+"价格的"+capacity+"座的车跑起来了...");
    }
    void stop(){
        System.out.println(brand+"牌子的"+color+"颜色的"+price+"价格的"+capacity+"座的车停止了...");
    }

}
